package cn.weakup.designpattern.c_structural.decorator;

/**
 * @author lixj
 * @version 1.0.0
 * @date 2022/6/4
 * @desc ConcreteComponent 定义具体对象，给此对象添加职责
 *       模拟单点登录功能
 */
public class SsoInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(String request, String response, Object handler) {
        // 模拟获取cookie
        String ticket = request.substring(0, 7);
        // 模拟校验
        return "success".equals(ticket);
    }
}
